// src/store/reducers/userInfo.ts
import { createSlice } from '@reduxjs/toolkit'

const userSlice = createSlice({
    name: 'userInfo',
    initialState: {
        token: "",
        state:"",//oAuth2.0的state
        loginState:"",
    },
    reducers: {
        setToken: (state, action) => {
            state.token = action.payload
        },
        setState: (state, action) => {
            state.state = action.payload
        },
        setLoginState: (state, action) => {
            state.loginState = action.payload
        },
    }
})

export const {setToken,setState,setLoginState} = userSlice.actions
export default userSlice.reducer